package com.sangmo.fts.process.inventory.service;

import com.sangmo.boot.framework.plugin.dataview.crud.service.BaseViewService;
import com.sangmo.boot.framework.plugin.dataview.data.IDataViewRepo;
import com.sangmo.fts.process.inventory.model.IfStockItem;
import com.sangmo.fts.process.inventory.repo.IfStockItemRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class IfStockItemEntityService extends BaseViewService<IfStockItem> {

    @Autowired
    private IfStockItemRepo ifStockItemRepo;

    @Override
    protected IDataViewRepo<IfStockItem> getRepo() {
        return ifStockItemRepo;
    }

    protected List<IfStockItem> saveAll(List<IfStockItem> stockItems) {
        return ifStockItemRepo.saveAll(stockItems);
    }

    protected List<IfStockItem> listByStockId(Long stockId) {
        return ifStockItemRepo.findByStockId(stockId);
    }
}
